﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Project.Library
{

    public interface IFile
    {
        int Init(String ConnectionString); // Used To Initilize Cloud Storage 
        String Read(String FileName);
        int Write(String FileName, String Data);
        int Write(String FileName, Stream stream);
        int Delete(String FileName);
        bool Exists(String FileName);
        int CreateFolder(String FolderName);
        int DeleteFolder(String FolderName);
        bool ExistsFolder(String FolderName);
    }

    public class File
    {
        private IFile oFile;
        public File(IFile oFile)
        {
            this.oFile = oFile;
        }

        public int Init(String ConnectionString)
        {
            return oFile.Init(ConnectionString);
        }
        
        public String Read(String FileName)
        {
            return oFile.Read(FileName);
        }

        public int Write(String FileName, String Data)
        {
            return oFile.Write(FileName, Data);
        }

        public int Write(String FileName, Stream stream)
        {
            return oFile.Write(FileName, stream);
        }
        
        public int Delete(String FileName)
        {
            return oFile.Delete(FileName);
        }

        public bool Exists(String FileName)
        {
            return oFile.Exists(FileName);
        }

        public int CreateFolder(String FolderName)
        {
            return oFile.CreateFolder(FolderName);
        }

        public int DeleteFolder(String FolderName)
        {
            return oFile.DeleteFolder(FolderName);
        }

        public bool ExistsFolder(String FolderName)
        {
            return oFile.ExistsFolder(FolderName);
        }
        
    }
}
